home *** CD-ROM | disk | FTP | other *** search
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++))))
-
-
-
- NNNNaaaammmmeeee
- RWTPtrVector<T> - Rogue Wave library class
-
- SSSSyyyynnnnooooppppssssiiiissss
- #include <rw/tpvector.h>
-
-
-
- RWTPtrVector<T> vec;
-
-
-
-
- DDDDeeeessssccccrrrriiiippppttttoooonnnn
- Class RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr<<<<TTTT>>>> is a simple parameterized vector of pointers to
- objects of type TTTT. It is most useful when you know precisely how many
- pointers must be held in the collection. If the intention is to "insert"
- an unknown number of objects into a collection, then class
- RRRRWWWWTTTTPPPPttttrrrrOOOOrrrrddddeeeerrrreeeeddddVVVVeeeeccccttttoooorrrr<<<<TTTT>>>> may be a better choice. The class TTTT can be of any
- type.
-
- PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
- Isomorphic
-
- EEEExxxxaaaammmmpppplllleeee
- #include <rw/tpvector.h>
- #include <rw/rwdate.h>
- #include <rw/rstream.h>
- main() {
- RWTPtrVector<RWDate> week(7);
- RWDate begin; // Today's date
- for (int i=0; i<7; i++)
- week[i] = new RWDate(begin++);
- for (i=0; i<7; i++)
- {
- cout << *week[i] << endl;
- delete week[i];
- }
- return 0;
- }
-
-
- Program output:
-
- March 16, 1996
- March 17, 1996
- March 18, 1996
- March 19, 1996
- March 20, 1996
- March 21, 1996
- March 22, 1996
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++))))
-
-
-
- PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrrssss
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr<<<<TTTT>>>>();
-
-
- Constructs an empty vector of length zero.
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr<<<<TTTT>>>>(size_t n);
-
-
- Constructs a vector of length nnnn. The initial values of the elements are
- undefined. Hence, they can (and probably will) be garbage.
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr<<<<TTTT>>>>(size_t n, T* ival);
-
-
- Constructs a vector of length nnnn, with each element pointing to the item
- ****iiiivvvvaaaallll.
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr<<<<TTTT>>>>(const RWTPtrVector& v);
-
-
- Constructs self as a shallow copy of vvvv. After construction, pointers
- held by the two vectors point to the same items.
-
- PPPPuuuubbbblllliiiicccc ooooppppeeeerrrraaaattttoooorrrrssss
- RWTPtrVector<T>&
- ooooppppeeeerrrraaaattttoooorrrr====(const RWTPtrVector<T>& v);
-
-
- Sets self to a shallow copy of vvvv. Afterwards, the two vectors will have
- the same length and pointersheld by the two vectors will point to the
- same items.
-
- RWTPtrVector<T>&
- ooooppppeeeerrrraaaattttoooorrrr====(T* p);
-
-
- Sets all elements in self to point to the item ****pppp.
-
- T*&
- ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i);
- T*
- ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i) const;
-
-
- Returns the iiiith value in the vector. The first variant can be used as an
- l-value, the second cannot. The index iiii must be between zero and the
- length of the vector, less one. No bounds checking is performed.
-
- T*&
- ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i);
- T*
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++)))) RRRRWWWWTTTTPPPPttttrrrrVVVVeeeeccccttttoooorrrr((((3333CCCC++++++++))))
-
-
-
- ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i) const;
-
-
- Returns the iiiith value in the vector. The first variant can be used as an
- lvalue, the second cannot. The index iiii must be between zero and the
- length of the vector, less one; or an exception of type TTTTOOOOOOOOLLLL____IIIINNNNDDDDEEEEXXXX will
- be thrown.
-
- PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
- T* const *
- ddddaaaattttaaaa() const;
-
-
- Returns a pointer to the raw data of the vector. Should be used with
- care.
-
- size_t
- lllleeeennnnggggtttthhhh() const;
-
-
- Returns the length of the vector.
-
- void
- rrrreeeesssshhhhaaaappppeeee(size_t N);
-
-
- Changes the length of the vector to NNNN. If this results in the vector
- being lengthened, then the initial value of the additional elements is
- undefined.
-
- void
- rrrreeeessssiiiizzzzeeee(size_t N);
-
-
- Changes the length of the vector to NNNN. If this results in the vector
- being lengthened, then the initial value of the additional elements is
- set to nnnniiiillll.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-